/**  
 * All rights Reserved, Designed By Android_Robot   
 * @Title:  ToolFragment.java   
 * @Package com.jiyi.activity.new_maintenance   
 * @Description:    TODO(用一句话描述该文件做什么)   
 * @author: HYM     
 * @date:   2017-8-31 下午3:40:20   
 * @version V1.0     
 */
package com.jiyi.activity.new_maintenance;

import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.jiyi.activity.escape.OwnerListWithMapActivity;
import com.jiyi.activity.supervision.BusiOwnerActivity;
import com.jiyi.activity.supervision.BusiPeopleActivity;
import com.jiyi.activity.supervision.SupervisionDataAnalysisActivity;
import com.jiyi.activity.supervision.SupervisionUserAddActivity;
import com.swift.maintenance.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @ClassName: ToolFragment
 * @Description:TODO(监管大队长)
 * @author: HYM
 * @date: 2017-8-31 下午3:40:20
 * 
 */
public class ToolSupervisionCaptainFragment extends Fragment {

	/* 头部 */
	@BindView(R.id.tvBack)
	TextView tvBack;
	@BindView(R.id.tvTitle)
	TextView tvTitle;
	@BindView(R.id.tvSearch)
	TextView tvSearch;

	@Override
	public View onCreateView(LayoutInflater inflater,
			@Nullable ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(
				R.layout.tool_supervision_captain_menu, null, false);
		ButterKnife.bind(this, view);
		init();
		return view;
	}

	private void init() {
		setTop();
	}

	/**
	 * @author: HYM
	 * @Title: setTop
	 * @Description: TODO(这里用一句话描述这个方法的作用) void
	 * @date: 2017-8-31
	 */
	private void setTop() {
		tvBack.setVisibility(View.GONE);
		tvTitle.setText("监管管理系统");
		Drawable searchDraw = getResources().getDrawable(
				R.mipmap.icon_tool_escape);
		searchDraw.setBounds(0, 0, searchDraw.getMinimumWidth(),
				searchDraw.getMinimumHeight());
		tvSearch.setCompoundDrawables(searchDraw, null, null, null);
		tvSearch.setText("");
	}

	@OnClick({ R.id.tvBusiArea, R.id.tvBusiQuery, R.id.tvCheck,
			R.id.tvDataAnalsis, R.id.rlAuthoritySetting, R.id.tvSearch,
			R.id.rlAddUser })
	public void onClick(View view) {
		Intent intent = null;
		switch (view.getId()) {
		case R.id.tvBusiArea:
			//业务管辖
			intent = new Intent(getContext(), BusiOwnerActivity.class);
			startActivity(intent);
			break;
		case R.id.tvSearch:
			// 逃生定位
			intent = new Intent(getContext(), OwnerListWithMapActivity.class);
			startActivity(intent);
			break;
		case R.id.rlAuthoritySetting:
			// 权限设置
			intent = new Intent(getContext(), BusiPeopleActivity.class);
			intent.putExtra("func", 2);
			startActivity(intent);

			break;
		case R.id.tvDataAnalsis:
			// 数据分析
			intent = new Intent(getContext(),
					SupervisionDataAnalysisActivity.class);
			startActivity(intent);
			break;
		case R.id.tvBusiQuery:
			// 业务查询
			intent = new Intent(getContext(), BusiPeopleActivity.class);
			startActivity(intent);
			break;
		case R.id.rlAddUser:
			//新增成员
			intent = new Intent(getContext(), SupervisionUserAddActivity.class);
			startActivity(intent);
			break;
		case R.id.tvCheck:
			//检测报告
			intent = new Intent(getContext(), BusiOwnerActivity.class);
			intent.putExtra("func", 2);
			startActivity(intent);
			break;
		default:
			break;
		}
	}
}
